﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _13_接口小练习
{
    class Program
    {
        static void Main(string[] args)
        {
            //实现多态方式的选择依据
            //  1 虚方法：
            //  2 抽象类：
            //  3 接口：

            //接口练习
            //真的鸭子会游泳、橡皮鸭子会游泳、木头鸭子不会游泳
            ISwimming swim = new RealDuck();
            swim.Swim();
            Console.ReadKey();
        }
    }

    public class RealDuck : ISwimming
    {
        public void Swim()
        {
            Console.WriteLine("真JJ会游泳");
        }
    }

    public class MuDuck : ISwimming
    {
        public void Swim()
        {
            Console.WriteLine("木头JJ不会游泳");
        }
    }

    public class XpDuck : ISwimming
    {
        public void Swim()
        {
            Console.WriteLine("橡皮JJ会游泳");
        }
    }

    public interface ISwimming
    {
        void Swim();
    }
}
